home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 10.9 KB | 492 lines | [TEXT/MPS ] |
- ;
- ; File: Speech.a
- ;
- ; Contains: Speech Interfaces.
- ;
- ; Version: Technology: System 7.5
- ; Release: Universal Interfaces 3.0d3 on Copland DR1
- ;
- ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
- IF &TYPE('__SPEECH__') = 'UNDEFINED' THEN
- __SPEECH__ SET 1
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
- include 'Memory.a'
- ENDIF
- IF &TYPE('__FILES__') = 'UNDEFINED' THEN
- include 'Files.a'
- ENDIF
- IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
-
- kTextToSpeechSynthType EQU 'ttsc'
- kTextToSpeechVoiceType EQU 'ttvd'
- kTextToSpeechVoiceFileType EQU 'ttvf'
- kTextToSpeechVoiceBundleType EQU 'ttvb'
-
- kNoEndingProsody EQU 1
- kNoSpeechInterrupt EQU 2
- kPreflightThenPause EQU 4
-
- kImmediate EQU 0
- kEndOfWord EQU 1
- kEndOfSentence EQU 2
- ; ------------------------------------------
- ; GetSpeechInfo & SetSpeechInfo selectors
- ; ------------------------------------------
-
- soStatus EQU 'stat'
- soErrors EQU 'erro'
- soInputMode EQU 'inpt'
- soCharacterMode EQU 'char'
- soNumberMode EQU 'nmbr'
- soRate EQU 'rate'
- soPitchBase EQU 'pbas'
- soPitchMod EQU 'pmod'
- soVolume EQU 'volm'
- soSynthType EQU 'vers'
- soRecentSync EQU 'sync'
- soPhonemeSymbols EQU 'phsy'
- soCurrentVoice EQU 'cvox'
- soCommandDelimiter EQU 'dlim'
- soReset EQU 'rset'
- soCurrentA5 EQU 'myA5'
- soRefCon EQU 'refc'
- soTextDoneCallBack EQU 'tdcb'
- soSpeechDoneCallBack EQU 'sdcb'
- soSyncCallBack EQU 'sycb'
- soErrorCallBack EQU 'ercb'
- soPhonemeCallBack EQU 'phcb'
- soWordCallBack EQU 'wdcb'
- soSynthExtension EQU 'xtnd'
- soSoundOutput EQU 'sndo'
- ; ------------------------------------------
- ; Speaking Mode Constants
- ; ------------------------------------------
-
- modeText EQU 'TEXT' ; input mode constants
- modePhonemes EQU 'PHON'
- modeNormal EQU 'NORM' ; character mode and number mode constants
- modeLiteral EQU 'LTRL'
-
- soVoiceDescription EQU 'info'
- soVoiceFile EQU 'fref'
- SpeechChannelRecord RECORD 0
- data ds.l 1 ; offset: $0 (0) <-- really an array of length one
- sizeof EQU * ; size: $4 (4)
- ENDR
- ; typedef struct SpeechChannelRecord * SpeechChannel
-
- VoiceSpec RECORD 0
- creator ds.l 1 ; offset: $0 (0)
- id ds.l 1 ; offset: $4 (4)
- sizeof EQU * ; size: $8 (8)
- ENDR
-
- kNeuter EQU 0
- kMale EQU 1
- kFemale EQU 2
- VoiceDescription RECORD 0
- length ds.l 1 ; offset: $0 (0)
- voice ds VoiceSpec ; offset: $4 (4)
- version ds.l 1 ; offset: $C (12)
- name ds Str63 ; offset: $10 (16)
- comment ds Str255 ; offset: $50 (80)
- gender ds.w 1 ; offset: $150 (336)
- age ds.w 1 ; offset: $152 (338)
- script ds.w 1 ; offset: $154 (340)
- language ds.w 1 ; offset: $156 (342)
- region ds.w 1 ; offset: $158 (344)
- reserved ds.l 4 ; offset: $15A (346)
- sizeof EQU * ; size: $16A (362)
- ENDR
- VoiceFileInfo RECORD 0
- fileSpec ds FSSpec ; offset: $0 (0)
- resID ds.w 1 ; offset: $46 (70)
- sizeof EQU * ; size: $48 (72)
- ENDR
- SpeechStatusInfo RECORD 0
- outputBusy ds.b 1 ; offset: $0 (0)
- outputPaused ds.b 1 ; offset: $1 (1)
- inputBytesLeft ds.l 1 ; offset: $2 (2)
- phonemeCode ds.w 1 ; offset: $6 (6)
- sizeof EQU * ; size: $8 (8)
- ENDR
- SpeechErrorInfo RECORD 0
- count ds.w 1 ; offset: $0 (0)
- oldest ds.w 1 ; offset: $2 (2)
- oldPos ds.l 1 ; offset: $4 (4)
- newest ds.w 1 ; offset: $8 (8)
- newPos ds.l 1 ; offset: $A (10)
- sizeof EQU * ; size: $E (14)
- ENDR
- SpeechVersionInfo RECORD 0
- synthType ds.l 1 ; offset: $0 (0)
- synthSubType ds.l 1 ; offset: $4 (4)
- synthManufacturer ds.l 1 ; offset: $8 (8)
- synthFlags ds.l 1 ; offset: $C (12)
- synthVersion ds NumVersion ; offset: $10 (16)
- sizeof EQU * ; size: $14 (20)
- ENDR
- PhonemeInfo RECORD 0
- opcode ds.w 1 ; offset: $0 (0)
- phStr ds Str15 ; offset: $2 (2)
- exampleStr ds Str31 ; offset: $12 (18)
- hiliteStart ds.w 1 ; offset: $32 (50)
- hiliteEnd ds.w 1 ; offset: $34 (52)
- sizeof EQU * ; size: $36 (54)
- ENDR
- PhonemeDescriptor RECORD 0
- phonemeCount ds.w 1 ; offset: $0 (0)
- thePhonemes ds PhonemeInfo ; offset: $2 (2) <-- really an array of length one
- sizeof EQU * ; size: $38 (56)
- ENDR
- SpeechXtndData RECORD 0
- synthCreator ds.l 1 ; offset: $0 (0)
- synthData ds.b 2 ; offset: $4 (4)
- sizeof EQU * ; size: $6 (6)
- ENDR
- DelimiterInfo RECORD 0
- startDelimiter ds.b 2 ; offset: $0 (0)
- endDelimiter ds.b 2 ; offset: $2 (2)
- sizeof EQU * ; size: $4 (4)
- ENDR
- ;
- ; pascal NumVersion SpeechManagerVersion(void )
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SpeechManagerVersion
- move.l #$0000000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SpeechManagerVersion
- ENDIF
-
- ;
- ; pascal OSErr MakeVoiceSpec(OSType creator, OSType id, VoiceSpec *voice)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _MakeVoiceSpec
- move.l #$0604000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION MakeVoiceSpec
- ENDIF
-
- ;
- ; pascal OSErr CountVoices(short *numVoices)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CountVoices
- move.l #$0108000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CountVoices
- ENDIF
-
- ;
- ; pascal OSErr GetIndVoice(short index, VoiceSpec *voice)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetIndVoice
- move.l #$030C000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetIndVoice
- ENDIF
-
- ;
- ; pascal OSErr GetVoiceDescription(VoiceSpec *voice, VoiceDescription *info, long infoLength)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetVoiceDescription
- move.l #$0610000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetVoiceDescription
- ENDIF
-
- ;
- ; pascal OSErr GetVoiceInfo(VoiceSpec *voice, OSType selector, void *voiceInfo)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetVoiceInfo
- move.l #$0614000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetVoiceInfo
- ENDIF
-
- ;
- ; pascal OSErr NewSpeechChannel(VoiceSpec *voice, SpeechChannel *chan)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _NewSpeechChannel
- move.l #$0418000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION NewSpeechChannel
- ENDIF
-
- ;
- ; pascal OSErr DisposeSpeechChannel(SpeechChannel chan)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _DisposeSpeechChannel
- move.l #$021C000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION DisposeSpeechChannel
- ENDIF
-
- ;
- ; pascal OSErr SpeakString(StringPtr s)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SpeakString
- move.l #$0220000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SpeakString
- ENDIF
-
- ;
- ; pascal OSErr SpeakText(SpeechChannel chan, Ptr textBuf, long textBytes)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SpeakText
- move.l #$0624000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SpeakText
- ENDIF
-
- ;
- ; pascal OSErr SpeakBuffer(SpeechChannel chan, Ptr textBuf, long textBytes, long controlFlags)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SpeakBuffer
- move.l #$0828000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SpeakBuffer
- ENDIF
-
- ;
- ; pascal OSErr StopSpeech(SpeechChannel chan)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _StopSpeech
- move.l #$022C000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION StopSpeech
- ENDIF
-
- ;
- ; pascal OSErr StopSpeechAt(SpeechChannel chan, long whereToStop)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _StopSpeechAt
- move.l #$0430000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION StopSpeechAt
- ENDIF
-
- ;
- ; pascal OSErr PauseSpeechAt(SpeechChannel chan, long whereToPause)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _PauseSpeechAt
- move.l #$0434000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION PauseSpeechAt
- ENDIF
-
- ;
- ; pascal OSErr ContinueSpeech(SpeechChannel chan)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _ContinueSpeech
- move.l #$0238000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION ContinueSpeech
- ENDIF
-
- ;
- ; pascal short SpeechBusy(void )
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SpeechBusy
- move.l #$003C000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SpeechBusy
- ENDIF
-
- ;
- ; pascal short SpeechBusySystemWide(void )
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SpeechBusySystemWide
- move.l #$0040000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SpeechBusySystemWide
- ENDIF
-
- ;
- ; pascal OSErr SetSpeechRate(SpeechChannel chan, Fixed rate)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SetSpeechRate
- move.l #$0444000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SetSpeechRate
- ENDIF
-
- ;
- ; pascal OSErr GetSpeechRate(SpeechChannel chan, Fixed *rate)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetSpeechRate
- move.l #$0448000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetSpeechRate
- ENDIF
-
- ;
- ; pascal OSErr SetSpeechPitch(SpeechChannel chan, Fixed pitch)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SetSpeechPitch
- move.l #$044C000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SetSpeechPitch
- ENDIF
-
- ;
- ; pascal OSErr GetSpeechPitch(SpeechChannel chan, Fixed *pitch)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetSpeechPitch
- move.l #$0450000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetSpeechPitch
- ENDIF
-
- ;
- ; pascal OSErr SetSpeechInfo(SpeechChannel chan, OSType selector, void *speechInfo)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SetSpeechInfo
- move.l #$0654000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SetSpeechInfo
- ENDIF
-
- ;
- ; pascal OSErr GetSpeechInfo(SpeechChannel chan, OSType selector, void *speechInfo)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetSpeechInfo
- move.l #$0658000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetSpeechInfo
- ENDIF
-
- ;
- ; pascal OSErr TextToPhonemes(SpeechChannel chan, Ptr textBuf, long textBytes, Handle phonemeBuf, long *phonemeBytes)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _TextToPhonemes
- move.l #$0A5C000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION TextToPhonemes
- ENDIF
-
- ;
- ; pascal OSErr UseDictionary(SpeechChannel chan, Handle dictionary)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _UseDictionary
- move.l #$0460000C,D0
- dc.w $A800
- EndM
- ELSE
- IMPORT_CFM_FUNCTION UseDictionary
- ENDIF
-
- ENDIF
- ENDIF ; __SPEECH__
-
-